package com.itheima.Demo;

import com.itheima.Utils.MybatisUtils;
import com.itheima.dao.OrderMapper;
import com.itheima.pojo.Order;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.junit.Test;

public class demo01 {
    //通过订单编号20140921003查询出**订单信息**，并查询出**下单人信息**。
    @Test
    public void finduserByID(){// 一对一
        SqlSessionFactory sqlSessionFactory = MybatisUtils.getSqlSessionFactory();
        SqlSession sqlSession = sqlSessionFactory.openSession();
        OrderMapper mapper = sqlSession.getMapper(OrderMapper.class);
        Order order = mapper.findUserByid("20140921003");
        System.out.println(order);
        sqlSession.close();
    }
}
